<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.11.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>cppMISC: CUVUDPClient类 参考</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<script type="text/javascript" src="../../clipboard.js"></script>
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../resize.js"></script>
<script type="text/javascript" src="../../cookie.js"></script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/searchdata.js"></script>
<script type="text/javascript" src="../../search/search.js"></script>
<script type="text/javascript" src="../../darkmode_toggle.js"></script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">cppMISC<span id="projectnumber">&#160;v1.1</span>
   </div>
   <div id="projectbrief">cppMisc 文档系统</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.11.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(1); });
/* @license-end */
</script>
<script type="text/javascript" src="../../menudata.js"></script>
<script type="text/javascript" src="../../menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('../../',true,false,'search.php','搜索',false);
  $(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){ initResizable(false); });
/* @license-end */
</script>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">载入中...</div>
<div class="SRStatus" id="Searching">搜索中...</div>
<div class="SRStatus" id="NoMatches">未找到</div>
</div>
</div>
</div>
</div>

</div><!-- top -->
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#nested-classes">类</a> &#124;
<a href="#pub-types">Public 类型</a> &#124;
<a href="#pub-methods">Public 成员函数</a> &#124;
<a href="#pub-attribs">Public 属性</a> &#124;
<a href="../../d7/dd5/class_c_u_v_u_d_p_client-members.html">所有成员列表</a>  </div>
  <div class="headertitle"><div class="title">CUVUDPClient类 参考</div></div>
</div><!--header-->
<div class="contents">

<p>使用libuv实现的客户端连接.主要面向PC端的应用开发支持，也可以将这个库移植到android和 IOS系统上完成三种应用上统一的接口。  
 <a href="#details">更多...</a></p>

<p><code>#include &lt;<a class="el" href="../../d1/d41/uv__udp__c_8hpp_source.html">uv_udp_c.hpp</a>&gt;</code></p>
<div class="dynheader">
CUVUDPClient 的协作图:</div>
<div class="dyncontent">
<div class="center"><img src="../../dd/da8/class_c_u_v_u_d_p_client__coll__graph.png" border="0" usemap="#a_c_u_v_u_d_p_client_coll__map" alt="Collaboration graph"/></div>
<map name="a_c_u_v_u_d_p_client_coll__map" id="a_c_u_v_u_d_p_client_coll__map">
<area shape="rect" title="使用libuv实现的客户端连接.主要面向PC端的应用开发支持，也可以将这个库移植到android和 IOS系统上完成三种应用上统一的接口。" alt="" coords="5,5,176,635"/>
</map>
</div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="nested-classes" name="nested-classes"></a>
类</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d1/d13/struct_c_u_v_u_d_p_client_1_1st__wd.html">st_wd</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-types" name="pub-types"></a>
Public 类型</h2></td></tr>
<tr class="memitem:a5a6f2da7e8e321136e4d2a2e2ab4c7c4" id="r_a5a6f2da7e8e321136e4d2a2e2ab4c7c4"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a5a6f2da7e8e321136e4d2a2e2ab4c7c4">err_code</a> { <br />
&#160;&#160;<a class="el" href="#a5a6f2da7e8e321136e4d2a2e2ab4c7c4a954bfb15e76031d882a0c8224ac8fd3c">ERR_UVCLIENT_INIT_MUTEX</a> = -1000
, <a class="el" href="#a5a6f2da7e8e321136e4d2a2e2ab4c7c4adb1fe56770b6b0137c89c80d103445fd">ERR_UVCLIENT_LOOP_CONFIG</a>
, <a class="el" href="#a5a6f2da7e8e321136e4d2a2e2ab4c7c4a59d32671aba83d6585a4d4f430cbd6c7">ERR_UVCLIENT_LOOP_INIT</a>
, <a class="el" href="#a5a6f2da7e8e321136e4d2a2e2ab4c7c4abeef9ec0f97e844e3d05996c698ef7ec">ERR_UVCLIENT_INIT_TCP</a>
, <br />
&#160;&#160;<a class="el" href="#a5a6f2da7e8e321136e4d2a2e2ab4c7c4ad1c8ace856f5873c978a70fb53005a0a">ERR_UVCLIENT_OPERATION</a>
, <a class="el" href="#a5a6f2da7e8e321136e4d2a2e2ab4c7c4a1015c8fb554edb866df2241034ddbc70">ERR_UVCLIENT_ALOCMEM</a>
, <a class="el" href="#a5a6f2da7e8e321136e4d2a2e2ab4c7c4ae467ec1d6298a3fb26365595fce4341f">ERR_UVCLIENT_CONNECTION</a>
, <a class="el" href="#a5a6f2da7e8e321136e4d2a2e2ab4c7c4a43f5378127959b2f6d72ee5e2cc15ed6">ERR_RESOLVE_DNS</a>
, <br />
&#160;&#160;<a class="el" href="#a5a6f2da7e8e321136e4d2a2e2ab4c7c4a36a0f9020995bc3215b0e4445ddbaeb6">OK</a> = 0
<br />
 }</td></tr>
<tr class="separator:a5a6f2da7e8e321136e4d2a2e2ab4c7c4"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public 成员函数</h2></td></tr>
<tr class="memitem:ab9e61439fdd13324385227b5464407fa" id="r_ab9e61439fdd13324385227b5464407fa"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ab9e61439fdd13324385227b5464407fa">CUVUDPClient</a> (const std::string &amp;url, int <a class="el" href="#a14695c91894f09e8bdb71d1771435441">port</a>)</td></tr>
<tr class="memdesc:ab9e61439fdd13324385227b5464407fa"><td class="mdescLeft">&#160;</td><td class="mdescRight">构造客户端对象  <br /></td></tr>
<tr class="separator:ab9e61439fdd13324385227b5464407fa"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a33a972b740da07acfd83c801fa1603b4" id="r_a33a972b740da07acfd83c801fa1603b4"><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a33a972b740da07acfd83c801fa1603b4">~CUVUDPClient</a> ()</td></tr>
<tr class="separator:a33a972b740da07acfd83c801fa1603b4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0ee1c096ae92172681081421731982ee" id="r_a0ee1c096ae92172681081421731982ee"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a0ee1c096ae92172681081421731982ee">connect</a> ()</td></tr>
<tr class="memdesc:a0ee1c096ae92172681081421731982ee"><td class="mdescLeft">&#160;</td><td class="mdescRight">连接操作。  <br /></td></tr>
<tr class="separator:a0ee1c096ae92172681081421731982ee"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa197846af21f283afd4fe1a6d5451876" id="r_aa197846af21f283afd4fe1a6d5451876"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#aa197846af21f283afd4fe1a6d5451876">connect</a> (const std::string &amp;url, int <a class="el" href="#a14695c91894f09e8bdb71d1771435441">port</a>)</td></tr>
<tr class="separator:aa197846af21f283afd4fe1a6d5451876"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae8c4c54ca1365668b496f1ce80a4d5d7" id="r_ae8c4c54ca1365668b496f1ce80a4d5d7"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ae8c4c54ca1365668b496f1ce80a4d5d7">operator bool</a> ()</td></tr>
<tr class="separator:ae8c4c54ca1365668b496f1ce80a4d5d7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abf1df16a268b9e83c2d5ce9fc1638a0e" id="r_abf1df16a268b9e83c2d5ce9fc1638a0e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="#a5a6f2da7e8e321136e4d2a2e2ab4c7c4">err_code</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#abf1df16a268b9e83c2d5ce9fc1638a0e">Send</a> (const char *data, size_t s)</td></tr>
<tr class="memdesc:abf1df16a268b9e83c2d5ce9fc1638a0e"><td class="mdescLeft">&#160;</td><td class="mdescRight">发送数据。这个函数发送的时候不会将要发送的数据拷贝到缓冲区中 因此需要在具体应用的时候进行数据内存管理。  <br /></td></tr>
<tr class="separator:abf1df16a268b9e83c2d5ce9fc1638a0e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af4ca766d83f425d979162d08b5700019" id="r_af4ca766d83f425d979162d08b5700019"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#af4ca766d83f425d979162d08b5700019">OnSend</a> (size_t s, <a class="el" href="#a5a6f2da7e8e321136e4d2a2e2ab4c7c4">err_code</a> e)</td></tr>
<tr class="memdesc:af4ca766d83f425d979162d08b5700019"><td class="mdescLeft">&#160;</td><td class="mdescRight">完成发送后会调用这个函数  <br /></td></tr>
<tr class="separator:af4ca766d83f425d979162d08b5700019"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a42e8d07c237642c1bf725b6b0592826c" id="r_a42e8d07c237642c1bf725b6b0592826c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a42e8d07c237642c1bf725b6b0592826c">OnRecv</a> (const char *buff, size_t s, <a class="el" href="#a5a6f2da7e8e321136e4d2a2e2ab4c7c4">err_code</a>)</td></tr>
<tr class="memdesc:a42e8d07c237642c1bf725b6b0592826c"><td class="mdescLeft">&#160;</td><td class="mdescRight">接收到数据后，调用这个函数  <br /></td></tr>
<tr class="separator:a42e8d07c237642c1bf725b6b0592826c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a51190a5d46ea8ce9caff0d876546817c" id="r_a51190a5d46ea8ce9caff0d876546817c"><td class="memItemLeft" align="right" valign="top">uv_udp_t *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a51190a5d46ea8ce9caff0d876546817c">Client</a> ()</td></tr>
<tr class="separator:a51190a5d46ea8ce9caff0d876546817c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac5fb0db3d190ee591403be6478a382c2" id="r_ac5fb0db3d190ee591403be6478a382c2"><td class="memItemLeft" align="right" valign="top">const std::string &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ac5fb0db3d190ee591403be6478a382c2">GetURL</a> () const</td></tr>
<tr class="separator:ac5fb0db3d190ee591403be6478a382c2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a87028d1b70937d9aabbb0df5cc0a39ee" id="r_a87028d1b70937d9aabbb0df5cc0a39ee"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a87028d1b70937d9aabbb0df5cc0a39ee">GetPort</a> ()</td></tr>
<tr class="separator:a87028d1b70937d9aabbb0df5cc0a39ee"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab5d10e0e945e1a91ff254871d01cc153" id="r_ab5d10e0e945e1a91ff254871d01cc153"><td class="memItemLeft" align="right" valign="top">const std::string &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ab5d10e0e945e1a91ff254871d01cc153">server</a> () const</td></tr>
<tr class="separator:ab5d10e0e945e1a91ff254871d01cc153"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a03c49814d30916d9bf96804e45ac2869" id="r_a03c49814d30916d9bf96804e45ac2869"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a03c49814d30916d9bf96804e45ac2869">server</a> (const std::string &amp;svr)</td></tr>
<tr class="separator:a03c49814d30916d9bf96804e45ac2869"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a14695c91894f09e8bdb71d1771435441" id="r_a14695c91894f09e8bdb71d1771435441"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a14695c91894f09e8bdb71d1771435441">port</a> ()</td></tr>
<tr class="separator:a14695c91894f09e8bdb71d1771435441"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0a2e3b951d3a5398d3c4ffc0a08e5aff" id="r_a0a2e3b951d3a5398d3c4ffc0a08e5aff"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a0a2e3b951d3a5398d3c4ffc0a08e5aff">port</a> (int port)</td></tr>
<tr class="separator:a0a2e3b951d3a5398d3c4ffc0a08e5aff"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a882539c888d5f77cb84cc1705e89e89e" id="r_a882539c888d5f77cb84cc1705e89e89e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="#a5a6f2da7e8e321136e4d2a2e2ab4c7c4">err_code</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a882539c888d5f77cb84cc1705e89e89e">Error</a> ()</td></tr>
<tr class="separator:a882539c888d5f77cb84cc1705e89e89e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8c1b9d349837e17b2511f7cd2f6c20b7" id="r_a8c1b9d349837e17b2511f7cd2f6c20b7"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a8c1b9d349837e17b2511f7cd2f6c20b7">Error</a> (int e)</td></tr>
<tr class="separator:a8c1b9d349837e17b2511f7cd2f6c20b7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab412cce5bf561cf4710cbd87e771b5d3" id="r_ab412cce5bf561cf4710cbd87e771b5d3"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ab412cce5bf561cf4710cbd87e771b5d3">ErrMsg</a> ()</td></tr>
<tr class="separator:ab412cce5bf561cf4710cbd87e771b5d3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5428547933c12503b91ff2dc11fc46b2" id="r_a5428547933c12503b91ff2dc11fc46b2"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a5428547933c12503b91ff2dc11fc46b2">need_dns</a> (const std::string &amp;url)</td></tr>
<tr class="separator:a5428547933c12503b91ff2dc11fc46b2"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-attribs" name="pub-attribs"></a>
Public 属性</h2></td></tr>
<tr class="memitem:afffd2bf3d059edbc434fc235e9c09887" id="r_afffd2bf3d059edbc434fc235e9c09887"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#afffd2bf3d059edbc434fc235e9c09887">m_dns_flag</a></td></tr>
<tr class="separator:afffd2bf3d059edbc434fc235e9c09887"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a106e2c331ef06d7315342a3ff9f6ea6f" id="r_a106e2c331ef06d7315342a3ff9f6ea6f"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a106e2c331ef06d7315342a3ff9f6ea6f">m_conn_flag</a></td></tr>
<tr class="separator:a106e2c331ef06d7315342a3ff9f6ea6f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab197687f41a9f254d121e97e69da3b2e" id="r_ab197687f41a9f254d121e97e69da3b2e"><td class="memItemLeft" align="right" valign="top">uv_mutex_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ab197687f41a9f254d121e97e69da3b2e">m_mutex</a></td></tr>
<tr class="separator:ab197687f41a9f254d121e97e69da3b2e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6937b113117e4ba9883d2772197ebfd3" id="r_a6937b113117e4ba9883d2772197ebfd3"><td class="memItemLeft" align="right" valign="top">uv_buf_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a6937b113117e4ba9883d2772197ebfd3">m_o_buf</a></td></tr>
<tr class="separator:a6937b113117e4ba9883d2772197ebfd3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7d199945978b9157e64400139ebc80d0" id="r_a7d199945978b9157e64400139ebc80d0"><td class="memItemLeft" align="right" valign="top">uv_buf_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a7d199945978b9157e64400139ebc80d0">m_i_buf</a></td></tr>
<tr class="separator:a7d199945978b9157e64400139ebc80d0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adcfc1d594a2c07b4974880be3fda7110" id="r_adcfc1d594a2c07b4974880be3fda7110"><td class="memItemLeft" align="right" valign="top">std::function&lt; void(size_t, const char *)&gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#adcfc1d594a2c07b4974880be3fda7110">cb_recv</a></td></tr>
<tr class="separator:adcfc1d594a2c07b4974880be3fda7110"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1741b75c5df3805d14c16a916bc15076" id="r_a1741b75c5df3805d14c16a916bc15076"><td class="memItemLeft" align="right" valign="top">std::function&lt; void(size_t)&gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a1741b75c5df3805d14c16a916bc15076">cb_send</a></td></tr>
<tr class="separator:a1741b75c5df3805d14c16a916bc15076"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5b1ce69d6083ef9dc876d7cd62eff460" id="r_a5b1ce69d6083ef9dc876d7cd62eff460"><td class="memItemLeft" align="right" valign="top">std::function&lt; void() &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a5b1ce69d6083ef9dc876d7cd62eff460">cb_close</a></td></tr>
<tr class="separator:a5b1ce69d6083ef9dc876d7cd62eff460"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aae5214f882c7644a75481a1e3f67dee1" id="r_aae5214f882c7644a75481a1e3f67dee1"><td class="memItemLeft" align="right" valign="top">std::function&lt; void() &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#aae5214f882c7644a75481a1e3f67dee1">cb_conn</a></td></tr>
<tr class="separator:aae5214f882c7644a75481a1e3f67dee1"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">详细描述</h2>
<div class="textblock"><p>使用libuv实现的客户端连接.主要面向PC端的应用开发支持，也可以将这个库移植到android和 IOS系统上完成三种应用上统一的接口。 </p>
<dl class="section version"><dt>版本</dt><dd>0.1 </dd></dl>
<dl class="section date"><dt>日期</dt><dd>2017-2-14 </dd></dl>
<dl class="section author"><dt>作者</dt><dd>宋炜 </dd></dl>

<p class="definition">在文件 <a class="el" href="../../d1/d41/uv__udp__c_8hpp_source.html">uv_udp_c.hpp</a> 第 <a class="el" href="../../d1/d41/uv__udp__c_8hpp_source.html#l00016">16</a> 行定义.</p>
</div><h2 class="groupheader">成员枚举类型说明</h2>
<a id="a5a6f2da7e8e321136e4d2a2e2ab4c7c4" name="a5a6f2da7e8e321136e4d2a2e2ab4c7c4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5a6f2da7e8e321136e4d2a2e2ab4c7c4">&#9670;&#160;</a></span>err_code</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="#a5a6f2da7e8e321136e4d2a2e2ab4c7c4">CUVUDPClient::err_code</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>客户端操作错误代码定义 </p>
<table class="fieldtable">
<tr><th colspan="2">枚举值</th></tr><tr><td class="fieldname"><a id="a5a6f2da7e8e321136e4d2a2e2ab4c7c4a954bfb15e76031d882a0c8224ac8fd3c" name="a5a6f2da7e8e321136e4d2a2e2ab4c7c4a954bfb15e76031d882a0c8224ac8fd3c"></a>ERR_UVCLIENT_INIT_MUTEX&#160;</td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="a5a6f2da7e8e321136e4d2a2e2ab4c7c4adb1fe56770b6b0137c89c80d103445fd" name="a5a6f2da7e8e321136e4d2a2e2ab4c7c4adb1fe56770b6b0137c89c80d103445fd"></a>ERR_UVCLIENT_LOOP_CONFIG&#160;</td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="a5a6f2da7e8e321136e4d2a2e2ab4c7c4a59d32671aba83d6585a4d4f430cbd6c7" name="a5a6f2da7e8e321136e4d2a2e2ab4c7c4a59d32671aba83d6585a4d4f430cbd6c7"></a>ERR_UVCLIENT_LOOP_INIT&#160;</td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="a5a6f2da7e8e321136e4d2a2e2ab4c7c4abeef9ec0f97e844e3d05996c698ef7ec" name="a5a6f2da7e8e321136e4d2a2e2ab4c7c4abeef9ec0f97e844e3d05996c698ef7ec"></a>ERR_UVCLIENT_INIT_TCP&#160;</td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="a5a6f2da7e8e321136e4d2a2e2ab4c7c4ad1c8ace856f5873c978a70fb53005a0a" name="a5a6f2da7e8e321136e4d2a2e2ab4c7c4ad1c8ace856f5873c978a70fb53005a0a"></a>ERR_UVCLIENT_OPERATION&#160;</td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="a5a6f2da7e8e321136e4d2a2e2ab4c7c4a1015c8fb554edb866df2241034ddbc70" name="a5a6f2da7e8e321136e4d2a2e2ab4c7c4a1015c8fb554edb866df2241034ddbc70"></a>ERR_UVCLIENT_ALOCMEM&#160;</td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="a5a6f2da7e8e321136e4d2a2e2ab4c7c4ae467ec1d6298a3fb26365595fce4341f" name="a5a6f2da7e8e321136e4d2a2e2ab4c7c4ae467ec1d6298a3fb26365595fce4341f"></a>ERR_UVCLIENT_CONNECTION&#160;</td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="a5a6f2da7e8e321136e4d2a2e2ab4c7c4a43f5378127959b2f6d72ee5e2cc15ed6" name="a5a6f2da7e8e321136e4d2a2e2ab4c7c4a43f5378127959b2f6d72ee5e2cc15ed6"></a>ERR_RESOLVE_DNS&#160;</td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="a5a6f2da7e8e321136e4d2a2e2ab4c7c4a36a0f9020995bc3215b0e4445ddbaeb6" name="a5a6f2da7e8e321136e4d2a2e2ab4c7c4a36a0f9020995bc3215b0e4445ddbaeb6"></a>OK&#160;</td><td class="fielddoc"></td></tr>
</table>

<p class="definition">在文件 <a class="el" href="../../d1/d41/uv__udp__c_8hpp_source.html">uv_udp_c.hpp</a> 第 <a class="el" href="../../d1/d41/uv__udp__c_8hpp_source.html#l00022">22</a> 行定义.</p>

</div>
</div>
<h2 class="groupheader">构造及析构函数说明</h2>
<a id="ab9e61439fdd13324385227b5464407fa" name="ab9e61439fdd13324385227b5464407fa"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab9e61439fdd13324385227b5464407fa">&#9670;&#160;</a></span>CUVUDPClient()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">CUVUDPClient::CUVUDPClient </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;</td>          <td class="paramname"><span class="paramname"><em>url</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int</td>          <td class="paramname"><span class="paramname"><em>port</em></span>&#160;)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>构造客户端对象 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">url,远程主机地址</td><td></td></tr>
    <tr><td class="paramname">port,远程服务端口</td><td></td></tr>
  </table>
  </dd>
</dl>

<p class="definition">在文件 <a class="el" href="../../de/d89/uv__udp__c_8cpp_source.html">uv_udp_c.cpp</a> 第 <a class="el" href="../../de/d89/uv__udp__c_8cpp_source.html#l00092">92</a> 行定义.</p>
<div class="dynheader">
函数调用图:</div>
<div class="dyncontent">
<div class="center"><img src="../../d0/db2/class_c_u_v_u_d_p_client_ab9e61439fdd13324385227b5464407fa_cgraph.png" border="0" usemap="#ad0/db2/class_c_u_v_u_d_p_client_ab9e61439fdd13324385227b5464407fa_cgraph" alt=""/></div>
<map name="ad0/db2/class_c_u_v_u_d_p_client_ab9e61439fdd13324385227b5464407fa_cgraph" id="ad0/db2/class_c_u_v_u_d_p_client_ab9e61439fdd13324385227b5464407fa_cgraph">
<area shape="rect" title="构造客户端对象" alt="" coords="5,5,219,32"/>
<area shape="rect" href="../../de/d44/classwheels_1_1dm_1_1singleton.html#ab064e1d47abf923e4ae0deaac875c173" title="获取当前的模块对象指针" alt="" coords="396,5,570,32"/>
<area shape="poly" title=" " alt="" coords="219,16,380,16,380,21,219,21"/>
<area shape="rect" href="../../d1/db2/uvlper_8cpp.html#a309790d96fad69beef3657811c68fc21" title="获取循环器" alt="" coords="267,31,348,57"/>
<area shape="poly" title=" " alt="" coords="220,30,252,34,251,39,219,35"/>
<area shape="poly" title=" " alt="" coords="348,36,380,31,381,36,349,41"/>
</map>
</div>

</div>
</div>
<a id="a33a972b740da07acfd83c801fa1603b4" name="a33a972b740da07acfd83c801fa1603b4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a33a972b740da07acfd83c801fa1603b4">&#9670;&#160;</a></span>~CUVUDPClient()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">CUVUDPClient::~CUVUDPClient </td>
          <td>(</td>
          <td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="../../de/d89/uv__udp__c_8cpp_source.html">uv_udp_c.cpp</a> 第 <a class="el" href="../../de/d89/uv__udp__c_8cpp_source.html#l00119">119</a> 行定义.</p>

</div>
</div>
<h2 class="groupheader">成员函数说明</h2>
<a id="a51190a5d46ea8ce9caff0d876546817c" name="a51190a5d46ea8ce9caff0d876546817c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a51190a5d46ea8ce9caff0d876546817c">&#9670;&#160;</a></span>Client()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">uv_udp_t * CUVUDPClient::Client </td>
          <td>(</td>
          <td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="../../d1/d41/uv__udp__c_8hpp_source.html">uv_udp_c.hpp</a> 第 <a class="el" href="../../d1/d41/uv__udp__c_8hpp_source.html#l00115">115</a> 行定义.</p>

</div>
</div>
<a id="a0ee1c096ae92172681081421731982ee" name="a0ee1c096ae92172681081421731982ee"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0ee1c096ae92172681081421731982ee">&#9670;&#160;</a></span>connect() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void CUVUDPClient::connect </td>
          <td>(</td>
          <td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>连接操作。 </p>
<dl class="section note"><dt>注解</dt><dd>UDP的连接操作和TCP存在差别，在这里UDP的连接操作只是解析域名将域名转化成 sockaddr 结构的指针 </dd></dl>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">url</td><td></td></tr>
    <tr><td class="paramname">port</td><td></td></tr>
  </table>
  </dd>
</dl>

<p class="definition">在文件 <a class="el" href="../../de/d89/uv__udp__c_8cpp_source.html">uv_udp_c.cpp</a> 第 <a class="el" href="../../de/d89/uv__udp__c_8cpp_source.html#l00186">186</a> 行定义.</p>
<div class="dynheader">
函数调用图:</div>
<div class="dyncontent">
<div class="center"><img src="../../d0/db2/class_c_u_v_u_d_p_client_a0ee1c096ae92172681081421731982ee_cgraph.png" border="0" usemap="#ad0/db2/class_c_u_v_u_d_p_client_a0ee1c096ae92172681081421731982ee_cgraph" alt=""/></div>
<map name="ad0/db2/class_c_u_v_u_d_p_client_a0ee1c096ae92172681081421731982ee_cgraph" id="ad0/db2/class_c_u_v_u_d_p_client_a0ee1c096ae92172681081421731982ee_cgraph">
<area shape="rect" title="连接操作。" alt="" coords="5,31,173,57"/>
<area shape="rect" href="../../de/d89/uv__udp__c_8cpp.html#ab57a3ea0a38c4578fa63d860a7255a90" title=" " alt="" coords="221,5,367,32"/>
<area shape="poly" title=" " alt="" coords="173,31,205,27,206,32,173,36"/>
<area shape="rect" href="../../de/d89/uv__udp__c_8cpp.html#a512dba1e1fcfd342fd54425e38907b63" title=" " alt="" coords="236,56,352,83"/>
<area shape="poly" title=" " alt="" coords="173,52,221,58,220,63,173,57"/>
<area shape="rect" href="../../d0/db2/class_c_u_v_u_d_p_client.html#a42e8d07c237642c1bf725b6b0592826c" title="接收到数据后，调用这个函数" alt="" coords="415,56,584,83"/>
<area shape="poly" title=" " alt="" coords="352,67,400,67,400,72,352,72"/>
</map>
</div>

</div>
</div>
<a id="aa197846af21f283afd4fe1a6d5451876" name="aa197846af21f283afd4fe1a6d5451876"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa197846af21f283afd4fe1a6d5451876">&#9670;&#160;</a></span>connect() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void CUVUDPClient::connect </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;</td>          <td class="paramname"><span class="paramname"><em>url</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int</td>          <td class="paramname"><span class="paramname"><em>port</em></span>&#160;)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="../../de/d89/uv__udp__c_8cpp_source.html">uv_udp_c.cpp</a> 第 <a class="el" href="../../de/d89/uv__udp__c_8cpp_source.html#l00219">219</a> 行定义.</p>

</div>
</div>
<a id="ab412cce5bf561cf4710cbd87e771b5d3" name="ab412cce5bf561cf4710cbd87e771b5d3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab412cce5bf561cf4710cbd87e771b5d3">&#9670;&#160;</a></span>ErrMsg()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">std::string CUVUDPClient::ErrMsg </td>
          <td>(</td>
          <td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="../../d1/d41/uv__udp__c_8hpp_source.html">uv_udp_c.hpp</a> 第 <a class="el" href="../../d1/d41/uv__udp__c_8hpp_source.html#l00150">150</a> 行定义.</p>

</div>
</div>
<a id="a882539c888d5f77cb84cc1705e89e89e" name="a882539c888d5f77cb84cc1705e89e89e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a882539c888d5f77cb84cc1705e89e89e">&#9670;&#160;</a></span>Error() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="#a5a6f2da7e8e321136e4d2a2e2ab4c7c4">err_code</a> CUVUDPClient::Error </td>
          <td>(</td>
          <td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="../../d1/d41/uv__udp__c_8hpp_source.html">uv_udp_c.hpp</a> 第 <a class="el" href="../../d1/d41/uv__udp__c_8hpp_source.html#l00133">133</a> 行定义.</p>

</div>
</div>
<a id="a8c1b9d349837e17b2511f7cd2f6c20b7" name="a8c1b9d349837e17b2511f7cd2f6c20b7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8c1b9d349837e17b2511f7cd2f6c20b7">&#9670;&#160;</a></span>Error() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void CUVUDPClient::Error </td>
          <td>(</td>
          <td class="paramtype">int</td>          <td class="paramname"><span class="paramname"><em>e</em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="../../d1/d41/uv__udp__c_8hpp_source.html">uv_udp_c.hpp</a> 第 <a class="el" href="../../d1/d41/uv__udp__c_8hpp_source.html#l00138">138</a> 行定义.</p>

</div>
</div>
<a id="a87028d1b70937d9aabbb0df5cc0a39ee" name="a87028d1b70937d9aabbb0df5cc0a39ee"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a87028d1b70937d9aabbb0df5cc0a39ee">&#9670;&#160;</a></span>GetPort()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">int CUVUDPClient::GetPort </td>
          <td>(</td>
          <td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="../../d1/d41/uv__udp__c_8hpp_source.html">uv_udp_c.hpp</a> 第 <a class="el" href="../../d1/d41/uv__udp__c_8hpp_source.html#l00125">125</a> 行定义.</p>

</div>
</div>
<a id="ac5fb0db3d190ee591403be6478a382c2" name="ac5fb0db3d190ee591403be6478a382c2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac5fb0db3d190ee591403be6478a382c2">&#9670;&#160;</a></span>GetURL()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">const std::string &amp; CUVUDPClient::GetURL </td>
          <td>(</td>
          <td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="../../d1/d41/uv__udp__c_8hpp_source.html">uv_udp_c.hpp</a> 第 <a class="el" href="../../d1/d41/uv__udp__c_8hpp_source.html#l00120">120</a> 行定义.</p>

</div>
</div>
<a id="a5428547933c12503b91ff2dc11fc46b2" name="a5428547933c12503b91ff2dc11fc46b2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5428547933c12503b91ff2dc11fc46b2">&#9670;&#160;</a></span>need_dns()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool CUVUDPClient::need_dns </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;</td>          <td class="paramname"><span class="paramname"><em>url</em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="../../de/d89/uv__udp__c_8cpp_source.html">uv_udp_c.cpp</a> 第 <a class="el" href="../../de/d89/uv__udp__c_8cpp_source.html#l00080">80</a> 行定义.</p>

</div>
</div>
<a id="a42e8d07c237642c1bf725b6b0592826c" name="a42e8d07c237642c1bf725b6b0592826c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a42e8d07c237642c1bf725b6b0592826c">&#9670;&#160;</a></span>OnRecv()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void CUVUDPClient::OnRecv </td>
          <td>(</td>
          <td class="paramtype">const char *</td>          <td class="paramname"><span class="paramname"><em>buff</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t</td>          <td class="paramname"><span class="paramname"><em>s</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="#a5a6f2da7e8e321136e4d2a2e2ab4c7c4">err_code</a></td>          <td class="paramname"><span class="paramname"><em>e</em></span>&#160;)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>接收到数据后，调用这个函数 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">buff</td><td>， 接收到的数据的缓冲区指针 </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">在文件 <a class="el" href="../../de/d89/uv__udp__c_8cpp_source.html">uv_udp_c.cpp</a> 第 <a class="el" href="../../de/d89/uv__udp__c_8cpp_source.html#l00227">227</a> 行定义.</p>
<div class="dynheader">
这是这个函数的调用关系图:</div>
<div class="dyncontent">
<div class="center"><img src="../../d0/db2/class_c_u_v_u_d_p_client_a42e8d07c237642c1bf725b6b0592826c_icgraph.png" border="0" usemap="#ad0/db2/class_c_u_v_u_d_p_client_a42e8d07c237642c1bf725b6b0592826c_icgraph" alt=""/></div>
<map name="ad0/db2/class_c_u_v_u_d_p_client_a42e8d07c237642c1bf725b6b0592826c_icgraph" id="ad0/db2/class_c_u_v_u_d_p_client_a42e8d07c237642c1bf725b6b0592826c_icgraph">
<area shape="rect" title="接收到数据后，调用这个函数" alt="" coords="385,5,554,32"/>
<area shape="rect" href="../../de/d89/uv__udp__c_8cpp.html#a512dba1e1fcfd342fd54425e38907b63" title=" " alt="" coords="221,5,337,32"/>
<area shape="poly" title=" " alt="" coords="369,21,338,21,338,16,369,16"/>
<area shape="rect" href="../../d0/db2/class_c_u_v_u_d_p_client.html#a0ee1c096ae92172681081421731982ee" title="连接操作。" alt="" coords="5,5,173,32"/>
<area shape="poly" title=" " alt="" coords="205,21,173,21,173,16,205,16"/>
</map>
</div>

</div>
</div>
<a id="af4ca766d83f425d979162d08b5700019" name="af4ca766d83f425d979162d08b5700019"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af4ca766d83f425d979162d08b5700019">&#9670;&#160;</a></span>OnSend()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void CUVUDPClient::OnSend </td>
          <td>(</td>
          <td class="paramtype">size_t</td>          <td class="paramname"><span class="paramname"><em>s</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="#a5a6f2da7e8e321136e4d2a2e2ab4c7c4">CUVUDPClient::err_code</a></td>          <td class="paramname"><span class="paramname"><em>e</em></span>&#160;)</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>完成发送后会调用这个函数 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">s,实际发送的长度</td><td></td></tr>
    <tr><td class="paramname">e,操作的错误代码</td><td></td></tr>
  </table>
  </dd>
</dl>

<p class="definition">在文件 <a class="el" href="../../de/d89/uv__udp__c_8cpp_source.html">uv_udp_c.cpp</a> 第 <a class="el" href="../../de/d89/uv__udp__c_8cpp_source.html#l00135">135</a> 行定义.</p>
<div class="dynheader">
这是这个函数的调用关系图:</div>
<div class="dyncontent">
<div class="center"><img src="../../d0/db2/class_c_u_v_u_d_p_client_af4ca766d83f425d979162d08b5700019_icgraph.png" border="0" usemap="#ad0/db2/class_c_u_v_u_d_p_client_af4ca766d83f425d979162d08b5700019_icgraph" alt=""/></div>
<map name="ad0/db2/class_c_u_v_u_d_p_client_af4ca766d83f425d979162d08b5700019_icgraph" id="ad0/db2/class_c_u_v_u_d_p_client_af4ca766d83f425d979162d08b5700019_icgraph">
<area shape="rect" title="完成发送后会调用这个函数" alt="" coords="393,5,561,32"/>
<area shape="rect" href="../../de/d89/uv__udp__c_8cpp.html#a212e4d97733307c8bca35dd0a0801d37" title=" " alt="" coords="205,5,345,32"/>
<area shape="poly" title=" " alt="" coords="378,21,345,21,345,16,378,16"/>
<area shape="rect" href="../../d0/db2/class_c_u_v_u_d_p_client.html#abf1df16a268b9e83c2d5ce9fc1638a0e" title="发送数据。这个函数发送的时候不会将要发送的数据拷贝到缓冲区中 因此需要在具体应用的时候进行数据内存管理。" alt="" coords="5,5,157,32"/>
<area shape="poly" title=" " alt="" coords="189,21,157,21,157,16,189,16"/>
</map>
</div>

</div>
</div>
<a id="ae8c4c54ca1365668b496f1ce80a4d5d7" name="ae8c4c54ca1365668b496f1ce80a4d5d7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae8c4c54ca1365668b496f1ce80a4d5d7">&#9670;&#160;</a></span>operator bool()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">CUVUDPClient::operator bool </td>
          <td>(</td>
          <td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="../../d1/d41/uv__udp__c_8hpp_source.html">uv_udp_c.hpp</a> 第 <a class="el" href="../../d1/d41/uv__udp__c_8hpp_source.html#l00085">85</a> 行定义.</p>

</div>
</div>
<a id="a14695c91894f09e8bdb71d1771435441" name="a14695c91894f09e8bdb71d1771435441"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a14695c91894f09e8bdb71d1771435441">&#9670;&#160;</a></span>port() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">int CUVUDPClient::port </td>
          <td>(</td>
          <td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="../../d1/d41/uv__udp__c_8hpp_source.html">uv_udp_c.hpp</a> 第 <a class="el" href="../../d1/d41/uv__udp__c_8hpp_source.html#l00131">131</a> 行定义.</p>

</div>
</div>
<a id="a0a2e3b951d3a5398d3c4ffc0a08e5aff" name="a0a2e3b951d3a5398d3c4ffc0a08e5aff"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0a2e3b951d3a5398d3c4ffc0a08e5aff">&#9670;&#160;</a></span>port() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void CUVUDPClient::port </td>
          <td>(</td>
          <td class="paramtype">int</td>          <td class="paramname"><span class="paramname"><em>port</em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="../../d1/d41/uv__udp__c_8hpp_source.html">uv_udp_c.hpp</a> 第 <a class="el" href="../../d1/d41/uv__udp__c_8hpp_source.html#l00132">132</a> 行定义.</p>
<div class="dynheader">
函数调用图:</div>
<div class="dyncontent">
<div class="center"><img src="../../d0/db2/class_c_u_v_u_d_p_client_a0a2e3b951d3a5398d3c4ffc0a08e5aff_cgraph.png" border="0" usemap="#ad0/db2/class_c_u_v_u_d_p_client_a0a2e3b951d3a5398d3c4ffc0a08e5aff_cgraph" alt=""/></div>
<map name="ad0/db2/class_c_u_v_u_d_p_client_a0a2e3b951d3a5398d3c4ffc0a08e5aff_cgraph" id="ad0/db2/class_c_u_v_u_d_p_client_a0a2e3b951d3a5398d3c4ffc0a08e5aff_cgraph">
<area shape="rect" title=" " alt="" coords="5,29,149,56"/>
<area shape="poly" title=" " alt="" coords="52,30,48,21,51,11,61,5,77,3,95,5,104,12,101,16,93,10,77,8,62,10,55,14,53,20,57,28"/>
</map>
</div>
<div class="dynheader">
这是这个函数的调用关系图:</div>
<div class="dyncontent">
<div class="center"><img src="../../d0/db2/class_c_u_v_u_d_p_client_a0a2e3b951d3a5398d3c4ffc0a08e5aff_icgraph.png" border="0" usemap="#ad0/db2/class_c_u_v_u_d_p_client_a0a2e3b951d3a5398d3c4ffc0a08e5aff_icgraph" alt=""/></div>
<map name="ad0/db2/class_c_u_v_u_d_p_client_a0a2e3b951d3a5398d3c4ffc0a08e5aff_icgraph" id="ad0/db2/class_c_u_v_u_d_p_client_a0a2e3b951d3a5398d3c4ffc0a08e5aff_icgraph">
<area shape="rect" title=" " alt="" coords="5,29,149,56"/>
<area shape="poly" title=" " alt="" coords="101,16,93,10,77,8,62,10,55,14,53,20,57,28,52,30,48,21,51,11,61,5,77,3,95,5,104,12"/>
</map>
</div>

</div>
</div>
<a id="abf1df16a268b9e83c2d5ce9fc1638a0e" name="abf1df16a268b9e83c2d5ce9fc1638a0e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abf1df16a268b9e83c2d5ce9fc1638a0e">&#9670;&#160;</a></span>Send()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="#a5a6f2da7e8e321136e4d2a2e2ab4c7c4">CUVUDPClient::err_code</a> CUVUDPClient::Send </td>
          <td>(</td>
          <td class="paramtype">const char *</td>          <td class="paramname"><span class="paramname"><em>data</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t</td>          <td class="paramname"><span class="paramname"><em>s</em></span>&#160;)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>发送数据。这个函数发送的时候不会将要发送的数据拷贝到缓冲区中 因此需要在具体应用的时候进行数据内存管理。 </p>
<dl class="section note"><dt>注解</dt><dd>因为UDP无法探测对点是否有效。所以当DNS解析出来多台服务器地址的时候无法确定 哪一个地址是有效的。因此需要解析后获取的目标地址应用可以有两个方案，一是向其中一个 地址发送数据;而是向每一个服务器发送数据。 </dd></dl>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">data,要发送的数据。</td><td></td></tr>
    <tr><td class="paramname">s,要发送的数据的长度</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>返回值</dt><dd>
  <table class="retval">
    <tr><td class="paramname">返回操作结果，成功返回OK,否则返回错误代码。</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="exception"><dt>异常</dt><dd>
  <table class="exception">
    <tr><td class="paramname">出现致命错误时抛出错误代码</td><td></td></tr>
  </table>
  </dd>
</dl>

<p class="definition">在文件 <a class="el" href="../../de/d89/uv__udp__c_8cpp_source.html">uv_udp_c.cpp</a> 第 <a class="el" href="../../de/d89/uv__udp__c_8cpp_source.html#l00143">143</a> 行定义.</p>
<div class="dynheader">
函数调用图:</div>
<div class="dyncontent">
<div class="center"><img src="../../d0/db2/class_c_u_v_u_d_p_client_abf1df16a268b9e83c2d5ce9fc1638a0e_cgraph.png" border="0" usemap="#ad0/db2/class_c_u_v_u_d_p_client_abf1df16a268b9e83c2d5ce9fc1638a0e_cgraph" alt=""/></div>
<map name="ad0/db2/class_c_u_v_u_d_p_client_abf1df16a268b9e83c2d5ce9fc1638a0e_cgraph" id="ad0/db2/class_c_u_v_u_d_p_client_abf1df16a268b9e83c2d5ce9fc1638a0e_cgraph">
<area shape="rect" title="发送数据。这个函数发送的时候不会将要发送的数据拷贝到缓冲区中 因此需要在具体应用的时候进行数据内存管理。" alt="" coords="5,5,157,32"/>
<area shape="rect" href="../../de/d89/uv__udp__c_8cpp.html#a212e4d97733307c8bca35dd0a0801d37" title=" " alt="" coords="205,5,345,32"/>
<area shape="poly" title=" " alt="" coords="157,16,189,16,189,21,157,21"/>
<area shape="rect" href="../../d0/db2/class_c_u_v_u_d_p_client.html#af4ca766d83f425d979162d08b5700019" title="完成发送后会调用这个函数" alt="" coords="393,5,561,32"/>
<area shape="poly" title=" " alt="" coords="345,16,377,16,377,21,345,21"/>
</map>
</div>

</div>
</div>
<a id="ab5d10e0e945e1a91ff254871d01cc153" name="ab5d10e0e945e1a91ff254871d01cc153"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab5d10e0e945e1a91ff254871d01cc153">&#9670;&#160;</a></span>server() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">const std::string &amp; CUVUDPClient::server </td>
          <td>(</td>
          <td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="../../d1/d41/uv__udp__c_8hpp_source.html">uv_udp_c.hpp</a> 第 <a class="el" href="../../d1/d41/uv__udp__c_8hpp_source.html#l00129">129</a> 行定义.</p>

</div>
</div>
<a id="a03c49814d30916d9bf96804e45ac2869" name="a03c49814d30916d9bf96804e45ac2869"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a03c49814d30916d9bf96804e45ac2869">&#9670;&#160;</a></span>server() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void CUVUDPClient::server </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;</td>          <td class="paramname"><span class="paramname"><em>svr</em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="../../d1/d41/uv__udp__c_8hpp_source.html">uv_udp_c.hpp</a> 第 <a class="el" href="../../d1/d41/uv__udp__c_8hpp_source.html#l00130">130</a> 行定义.</p>

</div>
</div>
<h2 class="groupheader">类成员变量说明</h2>
<a id="a5b1ce69d6083ef9dc876d7cd62eff460" name="a5b1ce69d6083ef9dc876d7cd62eff460"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5b1ce69d6083ef9dc876d7cd62eff460">&#9670;&#160;</a></span>cb_close</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">std::function&lt; void () &gt; CUVUDPClient::cb_close</td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="../../d1/d41/uv__udp__c_8hpp_source.html">uv_udp_c.hpp</a> 第 <a class="el" href="../../d1/d41/uv__udp__c_8hpp_source.html#l00053">53</a> 行定义.</p>

</div>
</div>
<a id="aae5214f882c7644a75481a1e3f67dee1" name="aae5214f882c7644a75481a1e3f67dee1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aae5214f882c7644a75481a1e3f67dee1">&#9670;&#160;</a></span>cb_conn</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">std::function&lt; void () &gt; CUVUDPClient::cb_conn</td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="../../d1/d41/uv__udp__c_8hpp_source.html">uv_udp_c.hpp</a> 第 <a class="el" href="../../d1/d41/uv__udp__c_8hpp_source.html#l00054">54</a> 行定义.</p>

</div>
</div>
<a id="adcfc1d594a2c07b4974880be3fda7110" name="adcfc1d594a2c07b4974880be3fda7110"></a>
<h2 class="memtitle"><span class="permalink"><a href="#adcfc1d594a2c07b4974880be3fda7110">&#9670;&#160;</a></span>cb_recv</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">std::function&lt; void ( size_t , const char * )&gt; CUVUDPClient::cb_recv</td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="../../d1/d41/uv__udp__c_8hpp_source.html">uv_udp_c.hpp</a> 第 <a class="el" href="../../d1/d41/uv__udp__c_8hpp_source.html#l00051">51</a> 行定义.</p>

</div>
</div>
<a id="a1741b75c5df3805d14c16a916bc15076" name="a1741b75c5df3805d14c16a916bc15076"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1741b75c5df3805d14c16a916bc15076">&#9670;&#160;</a></span>cb_send</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">std::function&lt; void ( size_t )&gt; CUVUDPClient::cb_send</td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="../../d1/d41/uv__udp__c_8hpp_source.html">uv_udp_c.hpp</a> 第 <a class="el" href="../../d1/d41/uv__udp__c_8hpp_source.html#l00052">52</a> 行定义.</p>

</div>
</div>
<a id="a106e2c331ef06d7315342a3ff9f6ea6f" name="a106e2c331ef06d7315342a3ff9f6ea6f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a106e2c331ef06d7315342a3ff9f6ea6f">&#9670;&#160;</a></span>m_conn_flag</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool CUVUDPClient::m_conn_flag</td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="../../d1/d41/uv__udp__c_8hpp_source.html">uv_udp_c.hpp</a> 第 <a class="el" href="../../d1/d41/uv__udp__c_8hpp_source.html#l00045">45</a> 行定义.</p>

</div>
</div>
<a id="afffd2bf3d059edbc434fc235e9c09887" name="afffd2bf3d059edbc434fc235e9c09887"></a>
<h2 class="memtitle"><span class="permalink"><a href="#afffd2bf3d059edbc434fc235e9c09887">&#9670;&#160;</a></span>m_dns_flag</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool CUVUDPClient::m_dns_flag</td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="../../d1/d41/uv__udp__c_8hpp_source.html">uv_udp_c.hpp</a> 第 <a class="el" href="../../d1/d41/uv__udp__c_8hpp_source.html#l00044">44</a> 行定义.</p>

</div>
</div>
<a id="a7d199945978b9157e64400139ebc80d0" name="a7d199945978b9157e64400139ebc80d0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7d199945978b9157e64400139ebc80d0">&#9670;&#160;</a></span>m_i_buf</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uv_buf_t CUVUDPClient::m_i_buf</td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="../../d1/d41/uv__udp__c_8hpp_source.html">uv_udp_c.hpp</a> 第 <a class="el" href="../../d1/d41/uv__udp__c_8hpp_source.html#l00048">48</a> 行定义.</p>

</div>
</div>
<a id="ab197687f41a9f254d121e97e69da3b2e" name="ab197687f41a9f254d121e97e69da3b2e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab197687f41a9f254d121e97e69da3b2e">&#9670;&#160;</a></span>m_mutex</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uv_mutex_t CUVUDPClient::m_mutex</td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="../../d1/d41/uv__udp__c_8hpp_source.html">uv_udp_c.hpp</a> 第 <a class="el" href="../../d1/d41/uv__udp__c_8hpp_source.html#l00046">46</a> 行定义.</p>

</div>
</div>
<a id="a6937b113117e4ba9883d2772197ebfd3" name="a6937b113117e4ba9883d2772197ebfd3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6937b113117e4ba9883d2772197ebfd3">&#9670;&#160;</a></span>m_o_buf</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uv_buf_t CUVUDPClient::m_o_buf</td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="../../d1/d41/uv__udp__c_8hpp_source.html">uv_udp_c.hpp</a> 第 <a class="el" href="../../d1/d41/uv__udp__c_8hpp_source.html#l00047">47</a> 行定义.</p>

</div>
</div>
<hr/>该类的文档由以下文件生成:<ul>
<li>include/<a class="el" href="../../d1/d41/uv__udp__c_8hpp_source.html">uv_udp_c.hpp</a></li>
<li>src/<a class="el" href="../../de/d89/uv__udp__c_8cpp_source.html">uv_udp_c.cpp</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
制作者&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.11.0
</small></address>
</div><!-- doc-content -->
</body>
</html>
